// Reflect

// Reflect是一个静态类，不能通过new去构造一个实例对象，只能去调用其静态方法，Math也是静态类

const obj = {
  foo: '123',
  bar: '456'
}

const proxy = new Proxy(obj, {
  get (target, property) {
    console.log('watch logic~')

    return Reflect.get(target, property)
  }
})

console.log(proxy.foo)

// Reflect提供了一套统一去操作对象的API

const obj2 = {
  name: 'zce',
  age: 18
}

// console.log('name' in obj)
// console.log(delete obj['age'])
// console.log(Object.keys(obj))

console.log(Reflect.has(obj2, 'name'))
console.log(Reflect.deleteProperty(obj2, 'age'))
console.log(Reflect.ownKeys(obj2))

console.log(obj2)
